<?php
include('/classes/SQL_class.php');
include('/classes/Site_class.php');
include('/classes/Document_class.php');
set_time_limit(0);
$temps_debut = microtime(true);
?>
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html version="-//W3C//DTD XHTML 1.1//EN"
      xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.w3.org/1999/xhtml
                          http://www.w3.org/MarkUp/SCHEMA/xhtml11.xsd"
>
  <head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Indexation - Web s&eacute;mantique</title>
  </head>
  <body>
<?php
	//supprimer la base
	Site::viderBaseIndexation();
	
	//Charger fichier stopliste
	Site::chargerStopFile();
	
	for($i = 1; $i <= 5; $i++)
	{
		$str = $i;
		while(strlen($str) < 3)
   			$str = '0'.$str;
		$file = './fichiers/d'.$str.'.xml';
		Document::ajouter('d'.$str.'.xml');
		$doc = new DOMDocument('1.0', 'utf-8');
		$doc->load($file);
		Site::parser($doc->documentElement, '/BALADE[1]', $i);
		echo 'Fichier : d'.$str.'.xml<br/>';
	}
	Site::ajouterMots();
	Site::ajouterParagraphes();
	Site::lierMotParagraphe();
	Site::lierTitreDocument();
	Site::ajouterSequences();
	Site::lierParagrapheSequence();
	Site::lierSequencesSousTitres();
	
	/* Du code ... */
	$temps_fin = microtime(true);
	echo 'Temps d\'execution : '.round($temps_fin - $temps_debut, 4).'s';
?> 
<br/><br/><a href="/websem/index.php" title="Retour &agrave; l'accueil">&lt;&lt; Retour &agrave; l'accueil</a>
</body>
</html>